<form class="form-horizontal" action="process.php" method="POST" autocomplete="off">
	<fieldset>
		<?php
			$fields = array("firstName", "lastName", "email", "pass", "passConf");
			$fieldn = array("First Name", "Last Name", "Email", "Password", "Confirm Password");
			$fieldt = array("text", "text", "text", "password", "password");
		?>
		
		<?php foreach($fields as $index=>$field): ?>
		
		<?php $error = ($form->error($field) != ""); ?>
		
		<div class="control-group <?php if ($error) echo "error"; ?>">
			<label class="control-label" for="<?php echo $field; ?>">
				<?php echo $fieldn[$index]; ?>
			</label>
			<div class="controls">
				<input value="<?php echo $form->value($field); ?>" type="<?php echo $fieldt[$index]; ?>" id="<?php echo $field; ?>" name="<?php echo $field; ?>">
				<?php if ($error) : ?>
					<span class="help-inline"><?php echo $form->error($field); ?></span>
				<?php endif; ?>
			</div>
		</div>
		
		<?php endforeach; ?>
		
		<div class="control-group">
			<label class="control-label" for="gender">Gender</label>
			<div class="controls">
				<select id="gender" name="gender">
					<option value="0">Female</option>
					<option value="1">Male</option>
				</select>
			</div>
		</div>
		
		<div class="form-actions">
			<button type="submit" class="btn btn-primary">Register</button>
			<button type="button" class="btn" id="reg-cancel-btn">Cancel</button>
		</div>
		
		<input type="hidden" name="subjoin" value="1">
	</fieldset>
</form>